#!/usr/bin/env python3
# -*- coding: utf-8 -*-
names = {'wangnan':1,'wangman':2,'yueyue':1}
names['wangnan'] = 95
names['wangman'] = 96
names['yueyue'] = 98

print(names['wangnan'])

d = {'Michael': 95, 'Bob': 75, 'Tracy': 85}
print(d['Michael'])
print(d.values())
L = d.values()
print(list(L))
#get()函数 和 in方法
print('wangnan' in d) #返回false

print(d.get('wangnan')) #默认返回none
print(d.get('wangnan',0)) #返回指定值 0

#pop（） 删除一个key
#print(d.pop('Bob',0)) #删除 并返回Bob的value 75 若Bob不存在则返回指定值 0 
print(d.pop('Bob')) #删除 并返回Bob的value 75
print(d)
print(d.pop('Bob',0)) #删除后再进行删除 返回指定值 0

d = {}
Key = (1,2,3)
d[Key] = '王楠'
a = {(1,2,3):'王楠'}
print(d)
print(d[Key])
print(a[(1,2,3)])

s = list(range(101))
n=0
m = {}
while n < len(s):
    m[s[n]] = 2*n +1
    n = n + 1
print(m)